app_family.controller("controller_familydata", function($scope, $rootScope, httpRequest, $location, $http) {
	$rootScope.$broadcast('currentModule', 'controller_familydata');
	$rootScope.$broadcast('footerFlag', false); // 是否显示底部导航
	$scope.imagebasepath = imagebasepath;
	
	/**
	 * 判断是否用手机登录过
	 */
	if (sessionStorage.getItem('data_sessionStorage')) {
		var familyPhone = JSON.parse(sessionStorage.getItem('data_sessionStorage')).familyInfo.phone;
		if (familyPhone == '' || familyPhone == null) {
			window.location.replace(basepath + 'login.html');
			return;
		}
	} else {
		window.location.replace(basepath + 'login.html');
		return;
	}
	
	// 判断居家还是院内
	$scope.user_type = data_sessionStorage.data_searchFamilyInfo.user_type; 
	$scope.older_account = data_sessionStorage.data_searchFamilyInfo.older_account; // 账号
	
	/**
	 * 根据账号，查询个人信息
	 */ 
	httpRequest.getOlderInfo({
		account : $scope.older_account
	}, function (data) {
		if (data.success === true) {
			$scope.olderInfoObj = data.obj;
		} else if (data.success === false) {
			$.dialog.showToast({msgTxt : data.msg});
		}
	});
	
	/**
	 * 跳转页面
	 */
	$scope.toOlderInfo = function (type) {
		if (type === 'data_dailyConsum') { // 居家-日常消费
			$location.path('/dataorder');
	    	$scope.$apply();
		} else if (type === 'data_healthRoom') { // 居家-健康小屋
			$location.path('/datahealthroom');
	    	$scope.$apply();
		} else if (type === 'data_lifeCalendar') { // 居家-生活日历
			$location.path('/datacalendar');
	    	$scope.$apply();
		} else if (type === 'in_data_dailyConsum') { // 院内-日常消费
			$location.path('/datadailyconsum');
	    	$scope.$apply();
		} else if (type === 'in_data_rest') { // 院内-订餐数据
			$location.path('/datarest');
	    	$scope.$apply();
		} else if (type === 'in_data_nurse') { // 院内-护理实绩
			$location.path('/datanurse');
	    	$scope.$apply();
		} else if (type === 'data_vitalsign') { // 院内-生命体征
			$location.path('/datavitalsign');
	    	$scope.$apply();
		}
	};
});